package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TGoodsCommentsMapper;
import com.ruoyi.system.domain.TGoodsComments;
import com.ruoyi.system.service.ITGoodsCommentsService;

/**
 * 商品评论信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-29
 */
@Service
public class TGoodsCommentsServiceImpl implements ITGoodsCommentsService 
{
    @Autowired
    private TGoodsCommentsMapper tGoodsCommentsMapper;

    /**
     * 查询商品评论信息
     * 
     * @param commentId 商品评论信息主键
     * @return 商品评论信息
     */
    @Override
    public TGoodsComments selectTGoodsCommentsByCommentId(String commentId)
    {
        return tGoodsCommentsMapper.selectTGoodsCommentsByCommentId(commentId);
    }

    /**
     * 查询商品评论信息列表
     * 
     * @param tGoodsComments 商品评论信息
     * @return 商品评论信息
     */
    @Override
    public List<TGoodsComments> selectTGoodsCommentsList(TGoodsComments tGoodsComments)
    {
        return tGoodsCommentsMapper.selectTGoodsCommentsList(tGoodsComments);
    }

    /**
     * 新增商品评论信息
     * 
     * @param tGoodsComments 商品评论信息
     * @return 结果
     */
    @Override
    public int insertTGoodsComments(TGoodsComments tGoodsComments)
    {
        tGoodsComments.setCreateTime(DateUtils.getNowDate());
        return tGoodsCommentsMapper.insertTGoodsComments(tGoodsComments);
    }

    /**
     * 修改商品评论信息
     * 
     * @param tGoodsComments 商品评论信息
     * @return 结果
     */
    @Override
    public int updateTGoodsComments(TGoodsComments tGoodsComments)
    {
        tGoodsComments.setUpdateTime(DateUtils.getNowDate());
        return tGoodsCommentsMapper.updateTGoodsComments(tGoodsComments);
    }

    /**
     * 批量删除商品评论信息
     * 
     * @param commentIds 需要删除的商品评论信息主键
     * @return 结果
     */
    @Override
    public int deleteTGoodsCommentsByCommentIds(String[] commentIds)
    {
        return tGoodsCommentsMapper.deleteTGoodsCommentsByCommentIds(commentIds);
    }

    /**
     * 删除商品评论信息信息
     * 
     * @param commentId 商品评论信息主键
     * @return 结果
     */
    @Override
    public int deleteTGoodsCommentsByCommentId(String commentId)
    {
        return tGoodsCommentsMapper.deleteTGoodsCommentsByCommentId(commentId);
    }
}
